package com.ohuang.wallpapermanager

import android.app.Activity
import android.app.WallpaperManager
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import androidx.core.app.ActivityCompat.startActivityForResult
import com.ohuang.wallpapermanager.wallPaperService.LockImageWallPaperService


object WallPaperServiceManager {

    fun start(context: Activity){
        val intent = Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER)
        intent.putExtra(
            WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
            ComponentName(context, LockImageWallPaperService::class.java)
        )
        context.startActivityForResult(intent, 0)
    }
}